package com.stylefeng.guns.modular.system.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.stylefeng.guns.modular.system.model.OrgcategoryFunction;
import com.stylefeng.guns.modular.system.model.OrgcategoryRole;
import org.springframework.dao.DataAccessException;

import java.util.List;

/**
 * <p>
 * 机构分类角色模板 Mapper 接口
 * </p>
 *
 * @author stylefeng
 * @since 2018-09-12
 */
public interface OrgcategoryRoleMapper extends BaseMapper<OrgcategoryRole> {
    
    void insert(OrgcategoryFunction relation);

    /**
     * 新增机构分类角色
     * @author sasazaixian
     * @date 2018-10-04
     * @param orgcategoryRole 机构分类角色对象
     * @return
     */
    int insertOrgcategoryRole(OrgcategoryRole orgcategoryRole)throws DataAccessException;

    /**
     * 更新机构分类角色
     * @author sasazaixian
     * @date 2018-10-04
     * @param orgcategoryRole 机构分类角色对象
     * @return
     */
    int updateOrgcategoryRole(OrgcategoryRole orgcategoryRole)throws DataAccessException;
    /**
     * 查询机构分类角色
     * @author sasazaixian
     * @date 2018-10-04
     * @param orgcategoryRole 机构分类角色对象
     * @return
     */
    List<OrgcategoryRole> selectListOrgcategoryRole(OrgcategoryRole orgcategoryRole)throws DataAccessException;
    /**
     * 查询机构分类角色
     * @author sasazaixian
     * @date 2018-10-04
     * @param page 分页对象
     * @param orgcategoryRole 机构分类角色对象
     * @return
     */
    List<OrgcategoryRole> selectListOrgcategoryRole(Page page, OrgcategoryRole orgcategoryRole)throws DataAccessException;
    /**
     * 根据id获取机构分类角色
     * @author sasazaixian
     * @date 2018-10-04
     * @param id 机构分类角色id
     * @return
     */
    OrgcategoryRole findOrgcategoryRoleById(String id)throws DataAccessException;
    /**
     * 删除机构分类角色
     * @author sasazaixian
     * @date 2018-10-04
     * @param ids 机构分类角色id数组
     * @return
     * */
    int deleteBatchOrgcategoryRole(String[] ids) throws DataAccessException;

    /**
     * 互斥锁查询时角色对象
     * @author sasazaixian
     * @date 2018-10-04
     * @param orgcategoryRole 机构分类角色对象
     * @return
     */
    List<OrgcategoryRole> selectListOrgcategoryRoleForUpdate(OrgcategoryRole orgcategoryRole)throws DataAccessException;

    /**
     * 互斥锁查询更新时角色名是否重复
     * @author sasazaixian
     * @date 2018-10-04
     * @param orgcategoryRole 机构分类角色对象
     * @return
     */
    List<OrgcategoryRole> selectListUpdateOrgcategoryRoleForUpdate( OrgcategoryRole orgcategoryRole)throws DataAccessException;
}
